<!DOCTYPE html>
<html>
<head>
    <meta charset='UTF-8'>
    <title>Document</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="root">
        <h2>欢迎{{name}}</h2>
        <input type="text" placeholder="按下回车提示输入" @keyup.huiche="showInfo">
    </div>
</body>
<!--   JS   -->
    <script>
        Vue.config.keyCodes.huiche = 13
        new Vue({
            el:'#root',
            data:{
                name:'琦琦'
            },
            methods:{
                showInfo(e){
                    //if(e.keyCode!==13) return
                    console.log(e.target.value) 
            }
            }
        })
    </script>
</html>